from Holiday import Holiday

class SimpleHoliday (Holiday):
    '''
    Class to represent holidays that happen on the same day each year
    '''

    def __init__ (self, description, year, month, day):
        Holiday.__init__(self, description)       
        self.year  = year
        self.day   = day
        self.month = month
        
    def __eq__(self, other):
        return (self.day == other.day) and (self.month == other.month) and (self.year == other.year)
        
    def __repr__(self):
        return "<SimpleHoliday(%d,%d,%d)>" % (self.year, self.month, self.day)

    def isholiday (self, when):
        return self.month == when.month and self.day == when.day
    
    def text (self):
        return "%04d-%04d-%02d" % (self.year, self.month, self.day)
    
    def type ():
        return "Simple"
    
    type = staticmethod (type)
    
